package ro.pub.cs.stadium.platform;

import org.eclipse.swt.widgets.Display;

public class StadiumApplication {
	
	/**
	 * The directory name of Stadium settings
	 */
	private final String stadiumDir = ".stadium";
	private final String settingsFile = "settings.xml";
	
	private Display appDisplay = null;
	private MainWindow mainWindow = null;
	
	private static StadiumApplication theApplication = null;
	
	private void createMainShell() {
		mainWindow = new MainWindow(appDisplay);
	}
	
	public StadiumApplication() {
		appDisplay = new Display();
		
		createMainShell();
	}
	
	public void run() {
		
	}
	
	public Display getDisplay() {
		return appDisplay;
	}
	
	public MainWindow getMainShell() {
		return mainWindow;
	}
	
	/**
	 * 
	 * @return a string representing the user specific path
	 * used to store settings and any other user data
	 */
	public String getUserStadiumPath() {
		return System.getProperty("user.home") + "/" + stadiumDir + "/";
	}
	
	public String getGlobalStadiumPath() {
		
	}
	
	/**
	 * 
	 * @return the name of the user specific settings file
	 */
	public String getUserSettingsFile() {
		return getStadiumPath() + settingsFile;
	}
	
	/**
	 * 
	 * @return the name of the global settings file
	 */
	public String getGlobalSettingsFile() {
		
	}
	
	public static StadiumApplication getApplication() {
		return theApplication;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		theApplication = new StadiumApplication();
		
		theApplication.run();
	}

}
